package com.binary.coder.gift.core.common.bean;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author weitao
 */
@Data
public class PageParam {

    @ApiModelProperty("当前页：从1开始")
    private long pageIndex = 1;
    @ApiModelProperty("页大小：默认20")
    private long pageSize = 10;

    public PageParam() {

    }

    public PageParam(long pageIndex, long pageSize) {
        this.pageIndex = pageIndex;
        this.pageSize = pageSize;
    }

    public Page toPage() {
        Page page = new Page(pageIndex, pageSize);
        return page;
    }
}
